package com.woniuxy.controller;

import com.woniuxy.entity.JacksonFormat;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @Author: linKe
 * @Date: 2021/11/24 16:11
 * @FileName: MyController
 * @version: 1.0
 * @Description: 第一个控制器
 */
@RestController
@RequestMapping("")
public class MyController {
    @RequestMapping("/index")
    public String one() {
        return "时候";
    }

    @RequestMapping("/ex")
    public String ex() {
        return "时候" + 1 / 0;
    }

    @RequestMapping("/mvcFormat")
    public String mvcFormat(@RequestParam Date times) {
        return times.toString();
    }

    @RequestMapping("/jacksonFormat")
    public String jacksonFormat(@RequestBody JacksonFormat jacksonFormat) {
        return jacksonFormat.toString();
    }
}
